import React from 'react'
import {List} from 'antd'
import '../style/css/compoments/sort.css'
const Sort =(props)=>{
    // const [ sortData , setSortData ] = useState([
    //     {name:'java',number:11},
    //     {name:'vue',number:15},
    //     {name:'react',number:100}
    // ])
    function sortUP (a, b){
      return b.count - a.count
    }
    const sortData = props.mytype.slice(0,10).sort(sortUP)
    const loading = false
    return(
        <div className="sort">
            <div className="sortMore">More ></div>
            <List
                header="分类"
                bordered
                loading={loading}
                dataSource={sortData}
                renderItem={item => (
                    <List.Item>
                      <div className="sortList">
                        <span className="sortName">{item.name}</span>
                        <span className="sortNum">{item.count}</span>
                      </div>
                    </List.Item>
                )}
                />
        </div>
    )
}
export default Sort;